package com.shujia

object Demo23Sort {
  def main(args: Array[String]): Unit = {


    val list: List[Int] = List(1, 2, 2, 3123, 123, 124, 123, 124, 12, 3, 2312)


    //指定排序的字段   默认是升序
    println(list.sortBy(i => -i))

    //闯入一个比较的规则
    println(list.sortWith((x, y) => x < y))


  }
}
